        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>ConstantVolumeJointDef class / box2d Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="box2d" data-type="ConstantVolumeJointDef">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../box2d.html">box2d</a> &rsaquo; <a href="../box2d/ConstantVolumeJointDef.html">ConstantVolumeJointDef</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>ConstantVolumeJointDef</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<pre class="source">
class ConstantVolumeJointDef extends JointDef {
 num frequencyHz;
 num dampingRatio;

 List&lt;Body&gt; bodies;
 List&lt;DistanceJoint&gt; joints;

 ConstantVolumeJointDef() :
   super(),
   bodies = new List&lt;Body&gt;(),
   joints = null,
   frequencyHz = 0.0,
   dampingRatio = 0.0 {
   type = JointType.CONSTANT_VOLUME;
   collideConnected = false;
 }

 /**
  * Adds a body to the group.
  */
 void addBody(Body argBody) {
   bodies.add(argBody);
   if (bodies.length == 1) {
     bodyA = argBody;
   } else if (bodies.length == 2) {
     bodyB = argBody;
   }
 }

 /**
  * Adds a body and the pre-made distance joint.  Should only
  * be used for deserialization.
  */
 void addBodyAndJoint(Body argBody, DistanceJoint argJoint) {
   addBody(argBody);
   if(joints == null){
     joints = new List&lt;DistanceJoint&gt;();
   }
   joints.add(argJoint);
 }
}
</pre>
</div>
<h3>Extends</h3>
<p>
<span class="type-box"><span class="icon-class"></span><a href="../box2d/JointDef.html">JointDef</a></span>&nbsp;&gt;&nbsp;<span class="type-box"><span class="icon-class"></span><strong>ConstantVolumeJointDef</strong></span></p>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="ConstantVolumeJointDef">
<button class="show-code">Code</button>
new <strong>ConstantVolumeJointDef</strong>() <a class="anchor-link" href="#ConstantVolumeJointDef"
              title="Permalink to ConstantVolumeJointDef.ConstantVolumeJointDef">#</a></h4>
<div class="doc">
<pre class="source">
ConstantVolumeJointDef() :
 super(),
 bodies = new List&lt;Body&gt;(),
 joints = null,
 frequencyHz = 0.0,
 dampingRatio = 0.0 {
 type = JointType.CONSTANT_VOLUME;
 collideConnected = false;
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="bodies">
<button class="show-code">Code</button>
List&lt;<a href="../box2d/Body.html">Body</a>&gt;         <strong>bodies</strong> <a class="anchor-link"
            href="#bodies"
            title="Permalink to ConstantVolumeJointDef.bodies">#</a>
        </h4>
        <div class="doc">
<pre class="source">
bodies
</pre>
</div>
</div>
<div class="field inherited"><h4 id="bodyA">
<button class="show-code">Code</button>
<a href="../box2d/Body.html">Body</a>         <strong>bodyA</strong> <a class="anchor-link"
            href="#bodyA"
            title="Permalink to ConstantVolumeJointDef.bodyA">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
bodyA
</pre>
</div>
</div>
<div class="field inherited"><h4 id="bodyB">
<button class="show-code">Code</button>
<a href="../box2d/Body.html">Body</a>         <strong>bodyB</strong> <a class="anchor-link"
            href="#bodyB"
            title="Permalink to ConstantVolumeJointDef.bodyB">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
bodyB
</pre>
</div>
</div>
<div class="field inherited"><h4 id="collideConnected">
<button class="show-code">Code</button>
bool         <strong>collideConnected</strong> <a class="anchor-link"
            href="#collideConnected"
            title="Permalink to ConstantVolumeJointDef.collideConnected">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
collideConnected
</pre>
</div>
</div>
<div class="field"><h4 id="dampingRatio">
<button class="show-code">Code</button>
num         <strong>dampingRatio</strong> <a class="anchor-link"
            href="#dampingRatio"
            title="Permalink to ConstantVolumeJointDef.dampingRatio">#</a>
        </h4>
        <div class="doc">
<pre class="source">
dampingRatio
</pre>
</div>
</div>
<div class="field"><h4 id="frequencyHz">
<button class="show-code">Code</button>
num         <strong>frequencyHz</strong> <a class="anchor-link"
            href="#frequencyHz"
            title="Permalink to ConstantVolumeJointDef.frequencyHz">#</a>
        </h4>
        <div class="doc">
<pre class="source">
frequencyHz
</pre>
</div>
</div>
<div class="field"><h4 id="joints">
<button class="show-code">Code</button>
List&lt;<a href="../box2d/DistanceJoint.html">DistanceJoint</a>&gt;         <strong>joints</strong> <a class="anchor-link"
            href="#joints"
            title="Permalink to ConstantVolumeJointDef.joints">#</a>
        </h4>
        <div class="doc">
<pre class="source">
joints
</pre>
</div>
</div>
<div class="field inherited"><h4 id="type">
<button class="show-code">Code</button>
int         <strong>type</strong> <a class="anchor-link"
            href="#type"
            title="Permalink to ConstantVolumeJointDef.type">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
type
</pre>
</div>
</div>
<div class="field inherited"><h4 id="userData">
<button class="show-code">Code</button>
Object         <strong>userData</strong> <a class="anchor-link"
            href="#userData"
            title="Permalink to ConstantVolumeJointDef.userData">#</a>
        </h4>
        <div class="inherited-from">inherited from <a href="../box2d/JointDef.html">JointDef</a> </div><div class="doc">
<pre class="source">
userData
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="addBody">
<button class="show-code">Code</button>
void <strong>addBody</strong>(<a href="../box2d/Body.html">Body</a> argBody) <a class="anchor-link" href="#addBody"
              title="Permalink to ConstantVolumeJointDef.addBody">#</a></h4>
<div class="doc">
<p>Adds a body to the group.</p>
<pre class="source">
void addBody(Body argBody) {
 bodies.add(argBody);
 if (bodies.length == 1) {
   bodyA = argBody;
 } else if (bodies.length == 2) {
   bodyB = argBody;
 }
}
</pre>
</div>
</div>
<div class="method"><h4 id="addBodyAndJoint">
<button class="show-code">Code</button>
void <strong>addBodyAndJoint</strong>(<a href="../box2d/Body.html">Body</a> argBody, <a href="../box2d/DistanceJoint.html">DistanceJoint</a> argJoint) <a class="anchor-link" href="#addBodyAndJoint"
              title="Permalink to ConstantVolumeJointDef.addBodyAndJoint">#</a></h4>
<div class="doc">
<p>Adds a body and the pre-made distance joint.  Should only
be used for deserialization.</p>
<pre class="source">
void addBodyAndJoint(Body argBody, DistanceJoint argJoint) {
 addBody(argBody);
 if(joints == null){
   joints = new List&lt;DistanceJoint&gt;();
 }
 joints.add(argJoint);
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
